\(\int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx\) [2370]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 65 \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\sqrt {-1-x+x^2}-\arctan \left (\frac {3-x}{2 \sqrt {-1-x+x^2}}\right )+\frac {1}{2} \text {arctanh}\left (\frac {1-2 x}{2 \sqrt {-1-x+x^2}}\right ) \]

[Out]

-arctan(1/2*(3-x)/(x^2-x-1)^(1/2))+1/2*arctanh(1/2*(1-2*x)/(x^2-x-1)^(1/2))-(x^2-x-1)^(1/2)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {748, 857, 635, 212, 738, 210} \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\arctan \left (\frac {3-x}{2 \sqrt {x^2-x-1}}\right )+\frac {1}{2} \text {arctanh}\left (\frac {1-2 x}{2 \sqrt {x^2-x-1}}\right )-\sqrt {x^2-x-1} \]

[In]

Int[Sqrt[-1 - x + x^2]/(1 - x),x]

[Out]

-Sqrt[-1 - x + x^2] - ArcTan[(3 - x)/(2*Sqrt[-1 - x + x^2])] + ArcTanh[(1 - 2*x)/(2*Sqrt[-1 - x + x^2])]/2

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 748

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(d + e*x)^(m + 1)*((
a + b*x + c*x^2)^p/(e*(m + 2*p + 1))), x] - Dist[p/(e*(m + 2*p + 1)), Int[(d + e*x)^m*Simp[b*d - 2*a*e + (2*c*
d - b*e)*x, x]*(a + b*x + c*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ
[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && GtQ[p, 0] && NeQ[m + 2*p + 1, 0] && ( !RationalQ[m] || Lt
Q[m, 1]) &&  !ILtQ[m + 2*p, 0] && IntQuadraticQ[a, b, c, d, e, m, p, x]

Rule 857

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = -\sqrt {-1-x+x^2}+\frac {1}{2} \int \frac {-3+x}{(1-x) \sqrt {-1-x+x^2}} \, dx \\ & = -\sqrt {-1-x+x^2}-\frac {1}{2} \int \frac {1}{\sqrt {-1-x+x^2}} \, dx-\int \frac {1}{(1-x) \sqrt {-1-x+x^2}} \, dx \\ & = -\sqrt {-1-x+x^2}+2 \text {Subst}\left (\int \frac {1}{-4-x^2} \, dx,x,\frac {3-x}{\sqrt {-1-x+x^2}}\right )-\text {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {-1+2 x}{\sqrt {-1-x+x^2}}\right ) \\ & = -\sqrt {-1-x+x^2}-\tan ^{-1}\left (\frac {3-x}{2 \sqrt {-1-x+x^2}}\right )-\frac {1}{2} \tanh ^{-1}\left (\frac {-1+2 x}{2 \sqrt {-1-x+x^2}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.91 \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\sqrt {-1-x+x^2}+2 \arctan \left (1-x+\sqrt {-1-x+x^2}\right )+\frac {1}{2} \log \left (1-2 x+2 \sqrt {-1-x+x^2}\right ) \]

[In]

Integrate[Sqrt[-1 - x + x^2]/(1 - x),x]

[Out]

-Sqrt[-1 - x + x^2] + 2*ArcTan[1 - x + Sqrt[-1 - x + x^2]] + Log[1 - 2*x + 2*Sqrt[-1 - x + x^2]]/2

Maple [A] (verified)

Time = 0.26 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.71

method result size
default \(-\sqrt {\left (-1+x \right )^{2}-2+x}-\frac {\ln \left (-\frac {1}{2}+x +\sqrt {\left (-1+x \right )^{2}-2+x}\right )}{2}+\arctan \left (\frac {-3+x}{2 \sqrt {\left (-1+x \right )^{2}-2+x}}\right )\) \(46\)
risch \(-\sqrt {x^{2}-x -1}-\frac {\ln \left (-\frac {1}{2}+x +\sqrt {x^{2}-x -1}\right )}{2}+\arctan \left (\frac {-3+x}{2 \sqrt {\left (-1+x \right )^{2}-2+x}}\right )\) \(46\)
trager \(-\sqrt {x^{2}-x -1}+\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\frac {-\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) x +2 \sqrt {x^{2}-x -1}+3 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )}{-1+x}\right )-\frac {\ln \left (2 \sqrt {x^{2}-x -1}-1+2 x \right )}{2}\) \(79\)

[In]

int((x^2-x-1)^(1/2)/(1-x),x,method=_RETURNVERBOSE)

[Out]

-((-1+x)^2-2+x)^(1/2)-1/2*ln(-1/2+x+((-1+x)^2-2+x)^(1/2))+arctan(1/2*(-3+x)/((-1+x)^2-2+x)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.78 \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\sqrt {x^{2} - x - 1} + 2 \, \arctan \left (-x + \sqrt {x^{2} - x - 1} + 1\right ) + \frac {1}{2} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} - x - 1} + 1\right ) \]

[In]

integrate((x^2-x-1)^(1/2)/(1-x),x, algorithm="fricas")

[Out]

-sqrt(x^2 - x - 1) + 2*arctan(-x + sqrt(x^2 - x - 1) + 1) + 1/2*log(-2*x + 2*sqrt(x^2 - x - 1) + 1)

Sympy [F]

\[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=- \int \frac {\sqrt {x^{2} - x - 1}}{x - 1}\, dx \]

[In]

integrate((x**2-x-1)**(1/2)/(1-x),x)

[Out]

-Integral(sqrt(x**2 - x - 1)/(x - 1), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.89 \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\sqrt {x^{2} - x - 1} + \arcsin \left (\frac {\sqrt {5} x}{5 \, {\left | x - 1 \right |}} - \frac {3 \, \sqrt {5}}{5 \, {\left | x - 1 \right |}}\right ) - \frac {1}{2} \, \log \left (2 \, x + 2 \, \sqrt {x^{2} - x - 1} - 1\right ) \]

[In]

integrate((x^2-x-1)^(1/2)/(1-x),x, algorithm="maxima")

[Out]

-sqrt(x^2 - x - 1) + arcsin(1/5*sqrt(5)*x/abs(x - 1) - 3/5*sqrt(5)/abs(x - 1)) - 1/2*log(2*x + 2*sqrt(x^2 - x
- 1) - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.80 \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\sqrt {x^{2} - x - 1} + 2 \, \arctan \left (-x + \sqrt {x^{2} - x - 1} + 1\right ) + \frac {1}{2} \, \log \left ({\left | -2 \, x + 2 \, \sqrt {x^{2} - x - 1} + 1 \right |}\right ) \]

[In]

integrate((x^2-x-1)^(1/2)/(1-x),x, algorithm="giac")

[Out]

-sqrt(x^2 - x - 1) + 2*arctan(-x + sqrt(x^2 - x - 1) + 1) + 1/2*log(abs(-2*x + 2*sqrt(x^2 - x - 1) + 1))

Mupad [F(-1)]

Timed out. \[ \int \frac {\sqrt {-1-x+x^2}}{1-x} \, dx=-\int \frac {\sqrt {x^2-x-1}}{x-1} \,d x \]

[In]

int(-(x^2 - x - 1)^(1/2)/(x - 1),x)

[Out]

-int((x^2 - x - 1)^(1/2)/(x - 1), x)